home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12901 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.luc.edu!user
  2. From: VArase@varase.it.luc.edu (Verne Arase)
  3. Newsgroups: comp.lang.misc,comp.lang.c,comp.lang.pl1,comp.lang.apl
  4. Subject: Re: GOTO controversy
  5. Date: Wed, 03 Apr 1996 07:37:11 -0600
  6. Organization: LUMC
  7. Message-ID: <AD87DB279668D9F74@mcdiala15.it.luc.edu>
  8. References: <314FB5F5.259B@simi.is> <3151B47F.70FD@connix.com> <4jo5t6$1ki@socrates.moe.edu.sg> <4jq2en$g2q@news.cais.com>
  9. NNTP-Posting-Host: 147.126.240.115
  10.  
  11. In article <4jq2en$g2q@news.cais.com>,
  12. dlabell@paltech.com (David Labell) wrote:
  13.  
  14.  >>: Looping with out a loop
  15.  >>
  16.  >>: no_loop(0,10);
  17.  >>
  18.  >>: no_loop(int start, int end)
  19.  >>: {
  20.  >>:     if(start != end) {
  21.  >>:         stuff
  22.  >>:         no_loop(start+1,end);
  23.  >>:     }
  24.  >>: }
  25.  >>
  26.  >>: I haven't tested this but you get the idea.
  27.  >
  28.  >Here's a guy who would rather recurse than loop. I don't mean to be rude,
  29.  >but this is typical of C programmers. Why not write it so it says what it
  30.  >does? 
  31.  >
  32.  >Who benefits from your tricks? 
  33.  
  34. People who write developer tools for debugging blown stacks and corrupted
  35. heaps :-).
  36.  
  37. Data dependent errors are the production programmer's worst nightmare;
  38. especially as they normally occur at 3:00 AM with some panicked operator
  39. who can't read english on the other end of the line.
  40.  
  41. I avoid recursion in _any_ production code, no matter how I can minimize
  42. the stack frame.
  43.  
  44. Recursion can make for visually appealing and simplified code, but in real
  45. terms they're nothing but trouble unless you can absolutely positively
  46. guarantee a finite, known level stack depth.
  47.  
  48. Nothing can compare to debugging some clever code in the middle of the
  49. night due to the fact that you've got in-order data strung out on a binary
  50. tree, traversed by recusion :-/.
  51.  
  52. ---
  53. The above are my own opinions, and not those of my employer.
  54.